<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<h1>1. 修改元素文本内容</h1>
		<span id="span01"></span>
		
		<h1>2. 修改元素html内容</h1>
		<div id="div01"></div>
		<div id="div02"></div>
		
		<h1>3. 修改元素的属性</h1>
		<input type="text" id="input1" />
		
		<h1>4. 修改元素的样式style</h1>
		<div id="div04"></div>
		
		<script type="text/javascript">
			span01.textContent = "哈哈"
			
			div01.textContent = "<a href='https://www.baidu.com'>百度</a>";
			
			div02.innerHTML = "<a href='https://www.baidu.com'>百度</a>";
			
			// 通过.修改元素属性
			input1.value = "娃娃~~"
			input1.name = "nickname";
			
			// 修改样式
			div04.style.background = "rgb(255,0,0)";
			div04.style.width = "100px";
			div04.style.height = "100px";
			
		</script>
		
	</body>
</html>